<div id="shop_id" class="c list_box f-l">
	<input type="text" name="adminname" class="input-text input-select" style="width:200px" autocomplete="off" readonly="1" placeholder="选择管理员" value="<?php echo $data['adminnames']?>">
	<input type="hidden" name="adminids" class="input-text input-select" style="width:200px" autocomplete="off" readonly="1" placeholder="" value="<?php echo $data['adminids'];?>">
	<div class="select" style="width:200px;">
		<ul>
		<?php 
		foreach(get_admin_list() as $k=>$v){
			echo '<label><li><input type="checkbox" data="'.$k.'" data2="'.$v.'"> '.$v.'</li></label>';
		}
		?>
		</ul>
	</div>
</div>
<input class="btn btn-default radius" type="button" value="清空" onclick="clear_all()" style="float:left;margin-left:5px;">	
<script type="text/javascript" src="<?php echo STATIC_URL;?>plugin/jquery/1.8.2/jquery.min.js"></script> 
<script>
function clear_all(){
	$('input[name="adminname"]').val('');
	$('input[type="checkbox"]').prop('checked', false);
	$('input[name="adminids"]').val('');
}
$(function(){
	$('#shop_id.list_box').on('mouseover',function(){
		$(this).find('.select').show();
	})

	$('#shop_id.list_box').on('mouseout',function(){
		$(this).find('.select').hide();
	})

	$('#shop_id.list_box li input').click(function(){
		let shop_id = [];
		let shop_name = []
		$(this).parents('ul').find('input').each(function(){
			let obj = $(this); 
			if(obj.is(':checked')){
				shop_id.push(obj.attr('data'));
				shop_name.push(obj.attr('data2'));
			}
		})
		$(this).parents('.select').prev().val(shop_id.join(','));
		$(this).parents('.select').prev().prev().val(shop_name.join(','));
	})
})
</script>